package cn.com.utt.unms.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import cn.com.utt.unms.pojo.Member;

@Mapper
public interface MemberMapper {

	@Select("select * from member where username=#{phone}")
	Member queryByPhone(@Param("phone") String phone);

	@Select("update member set total=total+1,last_time=#{lastTime} where username=#{username}")
	void updateTotal(Member member);

	@Insert("insert into member(username,password,type,first_time,last_time,total,sms_failures,update_time) values(#{username},#{password},#{type},#{firstTime},#{lastTime},#{total},#{smsFailures},#{updateTime})")
	void save(Member member);

}